﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;
using YF_Music.Core.Enums;

namespace YF_Music.Core.Converters
{
  public class PlayStateToDrawingConverter : IValueConverter
  {
    public Drawing PlayIcon { get; set; }
    public Drawing PauseIcon { get; set; }

    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
      if (value is PlayState state)
      {
        return state == PlayState.Playing ? PauseIcon : PlayIcon;
      }
      return PlayIcon;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
      throw new NotImplementedException();
    }
  }
}
